<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>node节点对象的原型继承</title>
</head>
<body>
    <h1>后盾人</h1>
    <input type="text" value="houdunren.com">
    <script>
        const h1 = document.querySelector('h1');
        const input  = document.querySelector('input');
        // 递归获取节点的原型
        function getElPrototype(el) {
            const prototypes = [];
            prototypes.push(el.__proto__);
            prototypes.push(...(el.__proto__ ? getElPrototype(el.__proto__) : []));
            return prototypes;
        }
        console.log(getElPrototype(h1));
        console.log(getElPrototype(input));
    </script>
</body>
</html>